import request from '@/utils/request'
/**
 * 获取组织架构列表
 */
export function getDepartmentList() {
  return request({
    url: 'http://localhost:3000/department',
    method: 'get'
  })
}

// 新增部门接口
export function addDepartment(data) {
  return request({
    url: 'http://localhost:3000/department',
    method: 'post',
    data
  })
}

// 获取表单详情
export function getDepartmentDetailById(id) {
  return request({
    url: `http://localhost:3000/department/${id}`,
    method: 'get'
  })
}

// 编辑部门接口
export function editDepartment(data) {
  return request({
    url: `http://localhost:3000/department/${data.id}`,
    method: 'put',
    data
  })
}

// 删除部门接口
export function delDepartment(id) {
  return request({
    url: `http://localhost:3000/department/${id}`,
    method: 'DELETE'
  })
}
